<?php if(Yii::app()->user->isGuest): ?>


<h1>Education over the World</h1>

<div id="introText">
<?php $this->widget('textedit.components.TextEditor', array('id'=>'home1')); ?>
<br/>
<a href="http://twitter.com/eduow" title="Follow us on Twitter" target="_blank" class="static"><img src="/images/share/twitter.png" alt="Twitter" /></a>

<a href="http://www.facebook.com/group.php?gid=113777061975682" title="Our group in facebook" target="_blank" class="static"><img src="/images/share/facebook.png" alt="Facebook" /></a>

<a href="http://groups.myspace.com/eduow" title="Our group in MySpace" target="_blank" class="static"><img src="/images/share/myspace.png" alt="MySpace" /></a>

<a href="/rss" title="RSS feed" target="_blank" class="static"><img src="/images/share/rss.png" alt="RSS" /></a>
</div>
<div id="langbox">
                <?php $this->widget('LangBox'); ?>
</div>
 
<?php $this->widget('UserLogin'); ?>


<div style="width:170px;position:absolute;right:40px;top:50px;color:#000000;background: url(<?php echo Yii::app()->request->baseUrl; ?>/images/arrow.jpg) no-repeat right top;">
<b>Chose your language</b><br/>
<b>Изберете си език</b><br/>
<b>اختار لغتك</b><br/>
<b>选择你的语言</b><br/>
<b>Choisissez votre langue</b><br/>
<b>Wähl deine Spräche</b><br/>
<b>Выберите ваш язык</b><br/>
<b>Elige tu idioma</b><br/>
</div>
<?php else: ?>

<div style="width:410px;float:right;text-align:right;" id="menuz">
<div id="langbox_user">
	<?php $this->widget('LangBox'); ?>
</div>
<h2><?php echo Yii::t('yii','Hello').', '.Yii::app()->user->name.'!'; ?></h2>
<div id="sort1" class="groupWrapper">
	<? if (Yii::app()->user->hasAuth(Group::TEACHER)): ?>
	<div class="groupItem">
	<div class="itemHeader"><?php echo Yii::t('yii','Teacher menu'); ?><a href="#" class="closeEl static">[-]</a></div>
	<div class="itemContent">
		<ul>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Create article'),array('/post/create')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Manage article'),array('/post/admin')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Create category'),array('/category/create')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Create program'),array('/programs/create')); ?></li>
		</ul>
	</div>
	</div>
	<?php endif; ?> 

	<? if(Yii::app()->user->hasAuth(Group::ADMIN)): ?>
	<div class="groupItem">
	<div class="itemHeader"><?php echo Yii::t('yii','Admin menu'); ?><a href="#" class="closeEl static">[-]</a></div>
	<div class="itemContent">
		<ul>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Shell'),array('/admin/shell')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Statistic'),array('/admin/statistic')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Bugs'),array('/bug/admin')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Articles'),array('/post/admin')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Categories'),array('/category/admin')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Comments'),array('/comment')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','News'),array('/news/admin')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Groups'),array('/group/list')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Users'),array('/user')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Email'),array('/email/failedEmail')); ?></li>
		</ul>
	</div>
	</div>
	<?php endif; ?> 
</div>
<div id="sort2" class="groupWrapper">
	<div class="groupItem">
	<div class="itemHeader"><?php echo Yii::t('yii','User menu'); ?><a href="#" class="closeEl static">[-]</a></div>
		<div class="itemContent">
		<ul>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Profile'),array('/user/settings')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Messages'),array('/msg')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Personal blog'),array('/blog')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Organizer'),array('/event')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Notes'),array('/note')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Propose article'),array('/post/create')); ?></li>
		</ul>
		</div>
	</div>

	<?php if (Yii::app()->user->hasAuth(Group::MODERATOR)): ?>
	<div class="groupItem">
	<div class="itemHeader"><?php echo Yii::t('yii','Moderator menu'); ?><a href="#" class="closeEl static">[-]</a></div>
	<div class="itemContent">
		<ul>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Email'),array('/email/failedEmail')); ?></li>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','Programs'),array('/programs')); ?></li>
		</ul>
	</div>
	</div>
	<?php endif; ?> 

	<?php if (Yii::app()->user->hasAuth(Group::TRANSLATOR)): ?>
	<div class="groupItem">
	<div class="itemHeader"><?php echo Yii::t('yii','Translator menu'); ?><a href="#" class="closeEl static">[-]</a></div>
	<div class="itemContent">
		<ul>
		<li><span class="ui-icon ui-icon-triangle-1-e"></span><?php echo Html::link(Yii::t('yii','TextEdit'),array('/textedit/admin/list')); ?></li>
		</ul>
	</div>
	</div>
	<?php endif; ?> 

</div>
</div>

<div id="umen">
<h2><?php echo Yii::t('yii','Whats new?'); ?></h2>
<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_event',
	'summaryText'=>'',
)); ?>
</div>

<script type="text/javascript">
$(function() {		
		
		
		$('a.closeEl').bind('click', toggleContent);
		$('div.groupWrapper').sortable(
			{
				accept: 'groupItem',
				helperclass: 'sortHelper',
				activeclass : 	'sortableactive',
				hoverclass : 	'sortablehover',
				handle: 'div.itemHeader',
				tolerance: 'pointer',
				onChange : function(ser)
				{
				},
				onStart : function()
				{
					$.iAutoscroller.start(this, document.getElementByID('menuz'));
				},
				onStop : function()
				{
					$.iAutoscroller.stop();
				}
			}
		);
});

var toggleContent = function(e)
{
	var targetContent = $('div.itemContent', this.parentNode.parentNode);
	if (targetContent.css('display') == 'none') {
		targetContent.slideDown(300);
		$(this).html('[-]');
	} else {
		targetContent.slideUp(300);
		$(this).html('[+]');
	}
	return false;
};

</script>
<?php endif; ?>
<script type="text/javascript">
$(function() {	
	$("#langdrop select").msDropDown({showIcon:false});
});
</script>
